
<?php

$t_uri = $_SERVER['REQUEST_URI'];
$t_val = strrchr($t_uri, '/');
$t_pos = strpos($t_val, '?');
if ($t_pos) {
  $t_val = substr($t_val, 0, $t_pos);
}

switch ($t_val) {
  case '/register':
    include 'api_register.php';
    break;
  case '/login':
    include 'api_login.php';
    break;
  case '/logout':
    include 'api_logout.php';
    break;
  case '/avatar_create':
    include 'api_avatar_create.php';
    break;
  case '/avatar_update':
    include 'api_avatar_update.php';
    break;
  case '/avatar_getself':
    include 'api_avatar_getself.php';
    break;
  case '/achievement_list':
    include 'api_achievement_list.php';
    break;
  case '/achievement_update':
    include 'api_achievement_update.php';
    break;
  case '/savefile_read':
    include 'api_savefile_read.php';
    break;
  case '/savefile_write':
    include 'api_savefile_write.php';
    break;
  case '/friend_add':
    include 'api_friend_add.php';
    break;
  case '/friend_remove':
    include 'api_friend_remove.php';
    break;
  case '/friend_list':
    include 'api_friend_list.php';
    break;
  case '/block_add':
    include 'api_block_add.php';
    break;
  case '/block_remove':
    include 'api_block_remove.php';
    break;
  case '/block_list':
    include 'api_block_list.php';
    break;
  case '/message_list':
    include 'api_message_list.php';
    break;
  case '/message_read':
    include 'api_message_read.php';
    break;
  case '/message_send':
    include 'api_message_send.php';
    break;
  case '/message_delete':
    include 'api_message_delete.php';
    break;
  default:
    echo 'ERROR=UNDEFINE_METHOD;';
    break;
}

?>
